{% extends "base.phtml" %}


{% block content %}

<div class="box box-primary">
    <div class="box-header with-border">
        <h3 class="box-title"></h3>
    </div>

    <form class="form-horizontal" action="save">
        <div class="box-body">
            <div class="form-group">
                <label class="col-sm-2 control-label">活动名称</label>

                <div class="col-sm-3">
                    <input type="text" name="title" value="{{data?data.title:''}}" class="form-control col-xs-3" placeholder="">
                </div>
            </div>

        <!--    <div class="form-group">
                <label class="col-sm-2 control-label">活动时间设定</label>
                <div class="col-sm-3">
                    <input style="height:35px;" name="stime"
                           value="{{data?date('Y-m-d H:i:s',data.stime):''}}" placeholder="请选择日期"
                           class="laydate-icon"
                           onclick="laydate({'istime': true, 'format': 'YYYY-MM-DD hh:mm:ss'})">
                    至
                    <input style="height:35px;" name="etime"
                           value="{{data?date('Y-m-d H:i:s',data.etime):''}}" placeholder="请选择日期"
                           class="laydate-icon"
                           onclick="laydate({'istime': true, 'format': 'YYYY-MM-DD hh:mm:ss'})">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">核销有效期设定</label>
                <div class="col-sm-3">
                    <input style="height:35px;" name="txstime"
                           value="{{data?date('Y-m-d H:i:s',data.txstime):''}}" placeholder="请选择日期"
                           class="laydate-icon"
                           onclick="laydate({'istime': true, 'format': 'YYYY-MM-DD hh:mm:ss'})">
                    至
                    <input style="height:35px;" name="txetime"
                           value="{{data?date('Y-m-d H:i:s',data.txetime):''}}" placeholder="请选择日期"
                           class="laydate-icon"
                           onclick="laydate({'istime': true, 'format': 'YYYY-MM-DD hh:mm:ss'})">
                </div>
            </div>-->

            <div class="form-group">
                <label class="col-sm-2 control-label">客服电话</label>

                <div class="col-sm-3">
                    <input type="text" name="phone" value="{{data?data.phone:''}}" class="form-control col-xs-3" placeholder="">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">活动价格</label>

                <div class="col-sm-3">
                    <input type="text" name="price" value="{{data?data.price:''}}" class="form-control col-xs-3" placeholder="">
                </div>
            </div>

            <div class="form-group uploadimg">
                <label class="col-sm-2 control-label">详情标题</label>

                <div class="col-sm-6">
                    <input type="text" name="detailTitle" value="{{data?data.detailTitle:''}}" class="form-control col-xs-3" placeholder="">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">活动描述</label>

                <div class="col-sm-6">
                    <input type="text" name="detailDesc" value="{{data?data.detailDesc:''}}" class="form-control col-xs-3" placeholder="">
                </div>
            </div>

            <div class="form-group uploadimg">
                <label class="col-sm-2 control-label">活动封面</label>
                <div class="col-sm-2">
                    <div class="filepicker" data-name="cover" data-pic="{{data?data.cover:''}}">上传</div>
                </div>
                <div class="col-sm-8 filelist"></div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">活动规则</label>

                <div class="col-sm-8">
                    <textarea id="rich_text">{{data?data.rule:''}}</textarea>
                </div>
            </div>
<!--
            <div class="form-group">
                <label class="col-sm-2 control-label">浏览量</label>
                <div class="col-sm-3">
                    <input type="text" name="views" value="{{data?data.views:'0'}}" class="form-control col-xs-3" placeholder="">
                </div>
            </div>-->

            <div class="form-group">
                <label class="col-sm-2 control-label">分享给朋友标题</label>
                <div class="col-sm-6">
                    <input type="text" name="shareTitle" value="{{data?data.shareTitle:''}}" class="form-control col-xs-3" placeholder="">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">分享给朋友文案</label>
                <div class="col-sm-6">
                    <input type="text" name="shareFriend" value="{{data?data.shareFriend:''}}" class="form-control col-xs-3" placeholder="">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">分享给朋友圈</label>
                <div class="col-sm-6">
                    <input type="text" name="shareCircle" value="{{data?data.shareCircle:''}}" class="form-control col-xs-3" placeholder="">
                </div>
            </div>

            <div class="form-group uploadimg">
                <label class="col-sm-2 control-label">分享图</label>
                <div class="col-sm-2">
                    <div class="filepicker" data-name="shareImage" data-pic="{{data?data.shareImage:''}}">上传</div>
                </div>
                <div class="col-sm-8 filelist"></div>
            </div>

        </div>

        <div class="box-footer text-center">
            <input type="hidden" value="{{data?data.id:0}}" name="id">
            <input type="hidden" value="" name="rule" />
            <button class="btn btn-info submit" onclick="save()">保存</button>
        </div>

    </form>
</div>
<script src="/ueditor/ueditor.config.js?v={{static_res_version}}"></script>
<script src="/ueditor/ueditor.all.js?v={{static_res_version}}"></script>
<script src="/ueditor/lang/zh-cn/zh-cn.js?v={{static_res_version}}"></script>
<script>
    function save() {
        var rule = ue.getContent();
        $('input[name="rule"]').val(rule)
    }
    var ue = UE.getEditor('rich_text', {
        autoHeight: false,
        textarea: 'publish_content',
        initialFrameHeight: 600
    });
    ue.addListener('contentChange', function () {
        ue.sync();
    });
</script>
{% endblock %}
